import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase="DBshop014_删除分类流程"
firefox=openBrowser(url)
firefox.get(urlAdmin)
DBshopLoginAdmin(firefox)
# 商品管理管理分类商品分类分类编辑
DBshopEnterMenu3(firefox,'商品管理','管理分类','商品分类')
# 1.点击分类名称为“商品分类测试”后方的删除分类"链接
firefox.find_element_by_xpath("//td[contains(.,'%s')]/following-sibling::td[4]/a[3]"%'商品分类测试').click()
firefox.switch_to.alert.accept()
firefox.refresh()
time.sleep(2)
try:
    firefox.find_element_by_xpath("//td[contains(.,'%s')]"%'商品分类测试')
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
firefox.quit()